<template>
  <div style="min-height:556px">

    <fan-card cardType="follow" v-for="(val,index) in dataList" :key="val.userId" :info="val"></fan-card>
    <empty-card v-if="dataList.length===0" height="556px"></empty-card>

    <pagination style="margin: 20px auto;" :pages="pages" v-on:listenPageChange="changePage"></pagination>

  </div>
</template>

<script>


  import FanCard from '../../../components/pc/fanCard';
  import config from '../../../action/config'
  import Pagination from '../../../components/pc/pagination';
  import EmptyCard from "../../../components/pc/emptyCard";

  export default {
    data(){
      return{
        dataList:[],
        pages:1,

      }
    },
    components:{

      FanCard,Pagination,EmptyCard


    },


    methods:{
      dataGetPeople(currentPage){
        this.$axios.$get(config.api.get.User.myFollowing,{
          params:{
            page:currentPage,
            size:10
          }
        }).then((response)=>{
          if(response.code===0){
            this.dataList=response.data.dataList;
            this.pages = response.data.totalPage;
          }
        })
      },
      changePage(currentPage){
        //返回页数 请求新的数据
        this.dataGetPeople(currentPage)
      }
    }

  }
</script>

<style lang="scss" scoped>

</style>
